/*
 * exame_2010_11_junho_Q2.c
 *
 *  Created on: Jun 18, 2012
 *      Author: ubuntu
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

char * pcript(char * f) {
	int strResultSize = 0;
	int i = 0;

	int strSize = strlen(f);

	char * strResult = (char *) malloc(sizeof(char) * strSize * 3);

	for (i = 0; i < strSize; i++) {

		char ch = tolower(f[i]);

		strResult[strResultSize] = f[i];
		strResultSize++;
		// se for vogal
		if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u') {

			strResult[strResultSize] = 'p';
			strResult[strResultSize + 1] = ch;
			strResultSize += 2;
		}

	}
	strResult[strResultSize] = '\0';

	return strResult;
}

int main(int argc, char **argv) {
	if (argc < 2) {
		fprintf(stderr, "Usage %s <s>\n", argv[0]);
		exit(EXIT_FAILURE);
	}

	printf("|%s|\n", pcript(argv[1]));
	return 0;
}
